<?php
    @header("Content-type:text/html;charset=utf-8");
    @include_once("./connect.php");

    $sql = "SELECT * FROM `indexgoods` where `hotsale-item` = '' limit 0,5";

    $result = mysqli_query($conn,$sql);

    $obj = array();
    if($result){
        $list = array();
        while($item = mysqli_fetch_assoc($result)){
            array_push($list,$item);
        }
        $obj["status"] = true;
        $obj["msg"] = "成功";
        $obj["list"] = $list;
    }else{
        $obj["status"] = false;
        $obj["msg"] = "输入的sql语句有误";
        $obj["sql"] = $sql;
    }
    echo json_encode($obj)


?>